const app = getApp()
const pointindex=0
Page({
  data: {
    
  },
  getMessage: function(res) {
    console.log(res.detail)  //拿到H5传的数据 id
  },
  onShareAppMessage:function(res){
      // this.getMessage()
  },
  onLoad: function (options) {
    // this.onShareAppMessage()
    // console.log(options)
    var that=this;
    var site = options.site
    var url
    let openId = 'oQUXz5IDxMpQcBvHaUayzE7Hy0R0';
    if(site=='1'){
      url = 'https://www.juquduo.com/juquduo/map/cygy'
    }
    if(site=='3'){
      url = 'https://www.juquduo.com/juquduo/map/scc'
    }
    if(site=='4'){
      url = 'https://www.juquduo.com/juquduo/map/gbsz'
    }
    if(site=='5'){
      url = 'https://www.juquduo.com/juquduo/map/ydjd'
    }
    
    that.setData({
      url: url
    })
    wx.getLocation({
      type: 'gcj02',
      success (ress) {
        const latitude = ress.latitude
        const longitude = ress.longitude
        const speed = ress.speed
        const accuracy = ress.accuracy
        that.setData({
          Lat:latitude,
          Lng:longitude
        })
      }
     })
    // wx.request({
    //   url: 'https://www.juquduo.com/juquduo/gaming/loading',
    //   data:{
    //     openid:'oQUXz5Cb-mrJq3o8Vct1Frcg2ClY',   
    //     activityId:256,
    //     isRelease:3,
    //   },
    //   success:function(res){
    //     // console.log(res)
    //     that.setData({
    //       data:res.data
    //     })
    //     var all=that.data.data
    //     var aalength =all.length
    //     all.unshift(all[aalength - 1])
    //     all.pop()
    //     var point = all
    //     console.log(point)
    //   }
    // })
  },
})
